package com.lin.springbootmvc.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class testController {
    @GetMapping("/{path:[a-z]+}/a")
    public String test(HttpServletRequest request, @PathVariable String path){
        String requestURI = request.getRequestURI();
        return requestURI + ":" + path;
    }
    @GetMapping("/path")
    public String path(HttpServletRequest request){
        String requestURI = request.getRequestURI();
        return requestURI;
    }
}
